home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
eflibpt4.zip
/
DEMO
/
WINDOWS
/
WINPERF.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1996-08-07
|
2KB
|
50 lines
{ Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
Demonstration; window performance test
EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
uses EFLIBDEF, EFLIBINI, EFLIBWIN, EFLIBBAS, EFLIBSCR, EFLIBMSE, EFLIBKBD;
const TestWindows = 500;
var Window : WindowObjectPointerType;
Level : word; X1, Y1, X2, Y2 : byte;
RunTimer : TimerObjectType;
begin
Mouse.HideCursor; RunTimer.Initialize;
RandSeed := 1; { Control random seed }
{ Standard (exploding) windows ... }
for Level := 1 to TestWindows div 2 do begin
{ Create random window object ... }
X1 := Succ(Random(Screen.Width div 2));
X2 := X1 + Succ(Random(Screen.Width div 2));
Y1 := Succ(Random(Screen.Height div 2));
Y2 := Y1 + Succ(Random(Screen.Height div 2));
{ Allocate window }
New (Window, InitializeWindow (X1, Y1, X2, Y2, '', ThinBorder, FALSE, FALSE));
Window^.Free; { Dispose window }
end;
{ Kept windows ... }
for Level := 1 to TestWindows div 2 do begin
{ Create random window object ... }
X1 := Succ(Random(Screen.Width div 2));
X2 := X1 + Succ(Random(Screen.Width div 2));
Y1 := Succ(Random(Screen.Height div 2));
Y2 := Y1 + Succ(Random(Screen.Height div 2));
{ Allocate window }
New (Window, InitializeWindow (X1, Y1, X2, Y2, 'Window speed!', DoubleBorder, FALSE, FALSE));
Window^.Free; { Dispose window }
end;
WriteLn (RunTimer.ElapsedMS:0:0,' ms for ', TestWindows, ' random windows ... that''s EFLIB!');
RunTimer.Intercept;
end.